<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>管理员后台</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
  <div class="d-flex">
    <nav class="flex-column bg-dark text-white p-3" style="width: 220px; height: 100vh;">
      <h4>后台管理</h4>
      <ul class="nav flex-column">
        <li class="nav-item"><a href="/admin/customers" class="nav-link text-white">客户管理</a></li>
        <li class="nav-item"><a href="/admin/cards" class="nav-link text-white">银行卡管理</a></li>
        <li class="nav-item"><a href="/admin/deposits" class="nav-link text-white">存款业务管理</a></li>
        <li class="nav-item"><a href="/admin/transactions" class="nav-link text-white">交易管理</a></li>
      </ul>
    </nav>
    <main class="flex-fill p-4">
      <h2>欢迎，管理员！</h2>
      <div id="stats"></div>
      <p>请选择左侧功能进行管理。</p>
    </main>
  </div>
  <script>
  async function loadStats() {
    const res = await fetch('/api/admin/dashboard');
    const data = await res.json();
    document.getElementById('stats').innerHTML = `
      <div class='alert alert-info'>
        用户数：${data.userCount}，卡片数：${data.cardCount}，总余额：${data.totalBalance}
      </div>
    `;
  }
  document.addEventListener('DOMContentLoaded', loadStats);
  </script>
  <script src="/static/js/main.js"></script>
</body>
</html>